package com.ruowei.modules.foodOrder.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import javax.validation.constraints.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.Instant;

/**
 * 订单退货表
 */
@ApiModel(description = "订单退货表")
@Entity
@Table(name = "order_return")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Deprecated
public class OrderReturn implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 退货编码
     */
    @ApiModelProperty(value = "退货编码")
    @Column(name = "return_code")
    private String returnCode;

    /**
     * 订单编码
     */
    @ApiModelProperty(value = "订单编码")
    @Column(name = "order_code")
    private String orderCode;

    /**
     * 申请时间
     */
    @ApiModelProperty(value = "申请时间")
    @Column(name = "application_time")
    private Instant applicationTime;

    /**
     * 退款金额
     */
    @ApiModelProperty(value = "退款金额")
    @Column(name = "return_amount", precision = 21, scale = 2)
    private BigDecimal returnAmount;

    /**
     * 申请状态
     */
    @ApiModelProperty(value = "申请状态,申请中，已退款，已拒绝")
    @Column(name = "application_status")
    private String applicationStatus;

    /**
     * 处理时间
     */
    @ApiModelProperty(value = "处理时间")
    @Column(name = "handle_time")
    private Instant handleTime;

    /**
     * 退货原因
     */
    @ApiModelProperty(value = "退货原因")
    @Lob
    @Column(name = "reason")
    private String reason;

    /**
     * 退货描述
     */
    @ApiModelProperty(value = "退货描述")
    @Lob
    @Column(name = "description")
    private String description;

    /**
     * 退货凭证照片
     */
    @Size(max = 2000)
    @ApiModelProperty(value = "退货凭证照片")
    @Column(name = "photos", length = 2000)
    private String photos;

    /**
     * 处理人
     */
    @ApiModelProperty(value = "处理人")
    @Column(name = "handler")
    private String handler;

    /**
     * 处理描述
     */
    @ApiModelProperty(value = "处理描述")
    @Lob
    @Column(name = "handle_remark")
    private String handleRemark;

    /**
     * 收货人
     */
    @ApiModelProperty(value = "收货人")
    @Column(name = "receiver")
    private String receiver;

    /**
     * 收货人电话
     */
    @ApiModelProperty(value = "收货人电话")
    @Column(name = "receiver_phone")
    private String receiverPhone;

    /**
     * 收货地址
     */
    @ApiModelProperty(value = "收货地址")
    @Column(name = "receiver_address")
    private String receiverAddress;

    /**
     * 收货时间
     */
    @ApiModelProperty(value = "收货时间")
    @Column(name = "receive_time")
    private Instant receiveTime;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getReturnCode() {
        return returnCode;
    }

    public OrderReturn returnCode(String returnCode) {
        this.returnCode = returnCode;
        return this;
    }

    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public OrderReturn orderCode(String orderCode) {
        this.orderCode = orderCode;
        return this;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public Instant getApplicationTime() {
        return applicationTime;
    }

    public OrderReturn applicationTime(Instant applicationTime) {
        this.applicationTime = applicationTime;
        return this;
    }

    public void setApplicationTime(Instant applicationTime) {
        this.applicationTime = applicationTime;
    }

    public BigDecimal getReturnAmount() {
        return returnAmount;
    }

    public OrderReturn returnAmount(BigDecimal returnAmount) {
        this.returnAmount = returnAmount;
        return this;
    }

    public void setReturnAmount(BigDecimal returnAmount) {
        this.returnAmount = returnAmount;
    }

    public String getApplicationStatus() {
        return applicationStatus;
    }

    public OrderReturn applicationStatus(String applicationStatus) {
        this.applicationStatus = applicationStatus;
        return this;
    }

    public void setApplicationStatus(String applicationStatus) {
        this.applicationStatus = applicationStatus;
    }

    public Instant getHandleTime() {
        return handleTime;
    }

    public OrderReturn handleTime(Instant handleTime) {
        this.handleTime = handleTime;
        return this;
    }

    public void setHandleTime(Instant handleTime) {
        this.handleTime = handleTime;
    }

    public String getReason() {
        return reason;
    }

    public OrderReturn reason(String reason) {
        this.reason = reason;
        return this;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getDescription() {
        return description;
    }

    public OrderReturn description(String description) {
        this.description = description;
        return this;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPhotos() {
        return photos;
    }

    public OrderReturn photos(String photos) {
        this.photos = photos;
        return this;
    }

    public void setPhotos(String photos) {
        this.photos = photos;
    }

    public String getHandler() {
        return handler;
    }

    public OrderReturn handler(String handler) {
        this.handler = handler;
        return this;
    }

    public void setHandler(String handler) {
        this.handler = handler;
    }

    public String getHandleRemark() {
        return handleRemark;
    }

    public OrderReturn handleRemark(String handleRemark) {
        this.handleRemark = handleRemark;
        return this;
    }

    public void setHandleRemark(String handleRemark) {
        this.handleRemark = handleRemark;
    }

    public String getReceiver() {
        return receiver;
    }

    public OrderReturn receiver(String receiver) {
        this.receiver = receiver;
        return this;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getReceiverPhone() {
        return receiverPhone;
    }

    public OrderReturn receiverPhone(String receiverPhone) {
        this.receiverPhone = receiverPhone;
        return this;
    }

    public void setReceiverPhone(String receiverPhone) {
        this.receiverPhone = receiverPhone;
    }

    public String getReceiverAddress() {
        return receiverAddress;
    }

    public OrderReturn receiverAddress(String receiverAddress) {
        this.receiverAddress = receiverAddress;
        return this;
    }

    public void setReceiverAddress(String receiverAddress) {
        this.receiverAddress = receiverAddress;
    }

    public Instant getReceiveTime() {
        return receiveTime;
    }

    public OrderReturn receiveTime(Instant receiveTime) {
        this.receiveTime = receiveTime;
        return this;
    }

    public void setReceiveTime(Instant receiveTime) {
        this.receiveTime = receiveTime;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof OrderReturn)) {
            return false;
        }
        return id != null && id.equals(((OrderReturn) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "OrderReturn{" +
            "id=" + getId() +
            ", returnCode='" + getReturnCode() + "'" +
            ", orderCode='" + getOrderCode() + "'" +
            ", applicationTime='" + getApplicationTime() + "'" +
            ", returnAmount=" + getReturnAmount() +
            ", applicationStatus='" + getApplicationStatus() + "'" +
            ", handleTime='" + getHandleTime() + "'" +
            ", reason='" + getReason() + "'" +
            ", description='" + getDescription() + "'" +
            ", photos='" + getPhotos() + "'" +
            ", handler='" + getHandler() + "'" +
            ", handleRemark='" + getHandleRemark() + "'" +
            ", receiver='" + getReceiver() + "'" +
            ", receiverPhone='" + getReceiverPhone() + "'" +
            ", receiverAddress='" + getReceiverAddress() + "'" +
            ", receiveTime='" + getReceiveTime() + "'" +
            "}";
    }
}
